package top.rainf.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.rainf.domain.vo.Block;
import top.rainf.domain.vo.UserBaseInfo;
import top.rainf.mapper.BlockMapper;
import top.rainf.service.IBlockService;

import java.util.List;

/**
 * @author 星环
 * @date 2023/5/10 11:58:53
 * @description
 */
@Service
public class BlockService implements IBlockService {

    @Autowired
    BlockMapper blockMapper;
    @Override
    public List<Block> getBlockList() {
        return blockMapper.selectAll();
    }

    @Override
    public Block getOne(int id) {
        return blockMapper.selectById(id);
    }

    @Override
    public int getTodayPostCount(int id) {
        return blockMapper.selectTodayPostCount(id);
    }

    @Override
    public List<UserBaseInfo> getBlockAdminList(int blockId) {
        return blockMapper.selectAllBlockAdminBaseInfo(blockId);
    }
}
